import { defineNuxtRouteMiddleware } from "nuxt/app";
const whiteList = ['/login', '/', '/course-center']
export default defineNuxtRouteMiddleware((to, from) => {
//     console.log(process)
        if (process.server) return

//         const nuxtApp = useNuxtApp()
//   if (process.client && nuxtApp.isHydrating && nuxtApp.payload.serverRendered) {
//       if(whiteList.includes(to.path)) return
      
//       // If the user is not authenticated
//       const userInfo = useUseInfo()
//       // console.log('auth........', to, userInfo)
//       if (!userInfo.value.tokenString) {
//           return navigateTo('/login')
//       }
//   }

})